package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /*
     *查询与套餐关联的菜品数量
     *
     * */
    Integer countByDishId(List<Long> ids);

    /**
     * 批量保存套餐和菜品的关联关系
     * @param setmealDishes
     */
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
    *
    * @return 根据套餐id删除套餐和菜品的关联关系
    * @author 小陈
    * @date
    */
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySetmealId(Long setmealId);
    
    /**
    *  
    * @return 根据菜的id查询对应的套餐
    * @author 小陈
    * @date  
    */
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);
}
